document.addEventListener('DOMContentLoaded', function() {
    var video = document.getElementById('myVideo');
    var brightnessRange = document.getElementById('brightness');
    var contrastRange = document.getElementById('contrast');
    var saturationRange = document.getElementById('saturation');

    brightnessRange.addEventListener('input', function() {
        applyFilters();
    });

    contrastRange.addEventListener('input', function() {
        applyFilters();
    });

    saturationRange.addEventListener('input', function() {
        applyFilters();
    });

    function applyFilters() {
        var brightnessValue = brightnessRange.value / 100;
        var contrastValue = contrastRange.value / 100;
        var saturationValue = saturationRange.value / 100;

        var filterValue = 'brightness(' + brightnessValue + ') ' +
                          'contrast(' + contrastValue + ') ' +
                          'saturate(' + saturationValue + ')';

        video.style.filter = filterValue;
    }
});
